/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package prop;

/**
 *
 * @author finfantasy
 */
public class DriverDomainRanking {
    DataManager dm;
    Ranking rank;
    public DriverDomainRanking(String nameRank) {
        dm = new DataManager(nameRank);
        rank = new Ranking(dm.cargarRanking());
    }

    public Posicion[] cargarRanking() {
        return dm.cargarRanking();
    }

    public void resetear() {
        rank.resetear();
        dm.guardarRanking(rank.getRanking());
    }

    public void insertar(String nombre, int puntos) {
        rank.insertar(nombre, puntos);
        dm.guardarRanking(rank.getRanking());
    }
}
